IGNITE-28944 Refactor SecurityBasicPermissionSet - #13424
Conversation
323b663 to
6668733
Compare
TCBot Test Analysis
Possible Blockers (0)No blockers found. New Tests (0)No new tests found. |
Possible compatibility issues. Please, check rolling upgrade casesThis PR modifies protected classes (with Order annotation). Affected files:
|
| } | ||
|
|
||
| /** @param map Map. */ | ||
| @SuppressWarnings("rawtypes") |
There was a problem hiding this comment.
| @SuppressWarnings("rawtypes") | |
| @SuppressWarnings({"rawtypes", "unchecked"}) |
| } | ||
|
|
||
| /** @param map Map. */ | ||
| @SuppressWarnings("rawtypes") |
There was a problem hiding this comment.
| @SuppressWarnings("rawtypes") | |
| @SuppressWarnings({"rawtypes", "unchecked"}) |
| } | ||
|
|
||
| /** */ | ||
| private void convert() { |
| * @param cachePermissions Cache permissions. | ||
| * @return Map with enum sets of security permissions. | ||
| */ | ||
| public static Map<String, Collection<SecurityPermission>> toEnumSetMap( |
There was a problem hiding this comment.
toEnumSetMap -> normalizeValueType?
|
|
||
| /** */ | ||
| private static EnumSet<SecurityPermission> copySafe(Collection<SecurityPermission> col) { | ||
| return col != null ? EnumSet.copyOf(col) : EnumSet.noneOf(SecurityPermission.class); |
There was a problem hiding this comment.
We can check if col is instanceof EnumSet<SecurityPermission>
| return upcast(srvcPerms); | ||
| } | ||
|
|
||
| /** @param map Map. */ |
There was a problem hiding this comment.
We need something more meaningful here, or we should simply leave it empty.
The same below.
|
|
||
| /** {@inheritDoc} */ | ||
| @Override public void unmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException { | ||
| // Message framework uses ArrayList for ordinary collectons, so we need convert it explicitly. |
| */ | ||
| static Collection<SecurityPermission> permissions(SecurityPermission... perms) { | ||
| Collection<SecurityPermission> col = U.newHashSet(perms.length); | ||
| static EnumSet<SecurityPermission> permissions(SecurityPermission... perms) { |
There was a problem hiding this comment.
It seems that we can drop this method and use EnumSet.of(<permisisons>) instead.
|
|
||
| /** */ | ||
| private static void authorizeAll(IgniteSecurity security, Map<String, Collection<SecurityPermission>> permissions) { | ||
| private static void authorizeAll(IgniteSecurity security, |
There was a problem hiding this comment.
No line break is needed here.
No description provided.